﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sinacor.Servico.Bovespa.Cliente.Service.ServiceImplementation.Translator.BusinessEntityToDataContract
{
    public class RelacionamentoBroker
    {
        public List<DataContract.Response.RelacionamentoBrokerResponse> ToRelacionamentoBrokerResponse(List<BusinessEntity.RelacionamentoBroker> from)
        {
            List<DataContract.Response.RelacionamentoBrokerResponse> to = null;

            if (from != null)
            {
                to = new List<DataContract.Response.RelacionamentoBrokerResponse>();

                foreach (BusinessEntity.RelacionamentoBroker item in from)
                {
                    to.Add(ToRelacionamentoBrokerResponse(item));
                }
            }

            return to;
        }

        public DataContract.Response.RelacionamentoBrokerResponse ToRelacionamentoBrokerResponse(BusinessEntity.RelacionamentoBroker from)
        {
            DataContract.Response.RelacionamentoBrokerResponse to = null;

            if (from != null)
            {
                to = new DataContract.Response.RelacionamentoBrokerResponse();

                to.ApelidoBrokerIntermediario = from.ApelidoBrokerIntermediario;
                to.ApelidoBrokerPrincipal = from.ApelidoBrokerPrincipal;
                to.CodigoBrokerCliente = from.CodigoBrokerCliente;
                to.CodigoBrokerIntermediario = from.CodigoBrokerIntermediario;
                to.CodigoBrokerPrincipal = from.CodigoBrokerPrincipal;
            }

            return to;
        }
    }
}
